Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AZURE TF Check - CKV_AZURE_136 #2331

Merged
merged 6 commits into from
Feb 4, 2022

Conversation

Aaditya-Nandeshwar
Copy link
Contributor

Hello,

Implementing check for Azure PostgreSQL FlexiServer GeoBackup Enabled in terraform.

Terraform Docs:
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server

Note:

If we have not pass the "geo_redundant_backup_enabled" argument in terraform then the check fails, as by default it will not provide backup facility.

If we have pass the "geo_redundant_backup_enabled" argument in terraform with value "false" in terraform template then the check fails, means we have turned off the backup facility.

If we have pass the "geo_redundant_backup_enabled" argument in terraform with value "true" in terraform template then the check passed, means we have turned on the backup facility.

License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@gruebel gruebel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice job 🚀

from checkov.common.models.enums import CheckResult


class TestPostgreSQLFlexiServerGeoBackupEnabled(unittest.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please adjust the tests, so they scan real terraform code, like here #2304

@Aaditya-Nandeshwar Aaditya-Nandeshwar changed the title AZURE TF Check - CKV_AWS_136 AZURE TF Check - CKV_AZURE_136 Feb 3, 2022
Aaditya-Nandeshwar and others added 2 commits February 3, 2022 22:32
Co-authored-by: Anton Grübel <anton.gruebel@gmail.com>
Copy link
Contributor

@gruebel gruebel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thanks for the contribution 🚀

@gruebel gruebel merged commit e7ae895 into bridgecrewio:master Feb 4, 2022
github-actions bot pushed a commit that referenced this pull request Feb 4, 2022
* Added check for georedundant PostgreSQLFlexiServer

* Added test for GeoRedundant PostgreSQLFlexiServer

* Added check for GeoRedundant PostgreSQLFlexiServer

* Corrected ClassName

* Apply suggestions from code review

Co-authored-by: Anton Grübel <anton.gruebel@gmail.com>

* Added tests for real terraform code

Co-authored-by: Anton Grübel <anton.gruebel@gmail.com>
Co-authored-by: Aaditya Nandeshwar <aaditya.nandeshwar@cldcvr.com>
github-actions bot pushed a commit that referenced this pull request Feb 4, 2022
* Added check for georedundant PostgreSQLFlexiServer

* Added test for GeoRedundant PostgreSQLFlexiServer

* Added check for GeoRedundant PostgreSQLFlexiServer

* Corrected ClassName

* Apply suggestions from code review

Co-authored-by: Anton Grübel <anton.gruebel@gmail.com>

* Added tests for real terraform code

Co-authored-by: Anton Grübel <anton.gruebel@gmail.com>
Co-authored-by: Aaditya Nandeshwar <aaditya.nandeshwar@cldcvr.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants